package com.huluobo.a2208mdmdemo2

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.navigation.NavHostController
import com.huluobo.a2208mdmdemo2.myview.MyView

/**
 *  Created by LC on 2025/2/5.
 */
@Composable
fun WelcomePage(navHostController: NavHostController) {
    Box {
        AndroidView(factory = {
            val myView = MyView(it, navHostController)
            myView.start()
            myView
        })
        Column(Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally) {
            Spacer(modifier = Modifier.height(100.dp))
            Image(painter = painterResource(id = R.drawable.img), contentDescription = "")
            Spacer(modifier = Modifier.height(20.dp))
            Text(text = "MDM")
        }
    }

}